import Vue from 'vue'
import Vuex from 'vuex'
import getlink from '@/apis/getapi.js'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    arr:[],
    arrs:[],
    arra:[],
  },
  mutations: {
    heishaer(state,payload){
      state.arr=payload.xinde
    },
    heie(state,payload){
      state.arrs=payload.xinde
    },
    hehe(state,payload){
      state.arra=payload.xinde
    }
  },
  actions: {
    heisha(context,payload){
      console.log(context)
      getlink(payload.url).then((ok)=>{
        console.log(ok.data.data)
        context.commit("heishaer",{xinde:ok.data.data})
      })
    },
    heisss(context,payload){
      console.log(context)
      getlink(payload.url).then((ok)=>{
        console.log(ok.data.mask)
        context.commit("heie",{xinde:ok.data.mask})
      })
    },
    zuihou(context,payload){
      console.log(context)
      getlink(payload.url).then((ok)=>{
        console.log(ok.data.ydzy)
        context.commit("hehe",{xinde:ok.data.ydzy})
      })
    }
  },
  
  modules: {
  }
})
